home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / games / nhak_src.zip / OBJCLASS.H < prev    next >
C/C++ Source or Header  |  1993-03-16  |  3KB  |  111 lines

  1. /*    SCCS Id: @(#)objclass.h    3.0    89/01/10
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3. /* NetHack may be freely redistributed.  See license for details. */
  4.  
  5. #ifndef OBJCLASS_H
  6. #define OBJCLASS_H
  7.  
  8. /* definition of a class of objects */
  9.  
  10. struct objclass {
  11.     const char *oc_name;        /* actual name */
  12.     const char *oc_descr;        /* description when name unknown */
  13.     char *oc_uname;            /* called by user */
  14.     Bitfield(oc_name_known,1);
  15.     Bitfield(oc_merge,1);    /* merge otherwise equal objects */
  16.     Bitfield(oc_uses_known,1); /* obj->known affects full decription */
  17.                 /* otherwise, obj->dknown and obj->bknown */
  18.                 /* tell all, and obj->known should always */
  19.                 /* be set for proper merging behavior */
  20.     Bitfield(oc_bool,1);
  21. #define oc_bimanual    oc_bool    /* for weapons */
  22. #define oc_bulky    oc_bool    /* for armor */
  23. #define oc_charged    oc_bool    /* for rings & tools: allow +n or (n) */
  24.     Bitfield(oc_material,4);
  25. #define GLASS        1
  26. #define WOOD        2
  27. #define COPPER        3 /* Cu */
  28. #define METAL        4 /* Fe */
  29. #define SILVER        5 /* Ag */
  30. #define GOLD        6 /* Au */
  31. #define PLATINUM    7 /* Pt */
  32. #define MITHRIL        8
  33. #define MINERAL        15
  34.     uchar oc_oprop;     /* property (invis, &c.) conveyed */
  35.     char oc_olet;
  36.     int oc_prob;        /* probability for mkobj() */
  37.     schar oc_delay;        /* delay when using such an object */
  38.     uchar oc_weight;
  39.     int oc_cost;        /* base cost in shops */
  40.     schar oc_oc1, oc_oc2;
  41.     int oc_oi;
  42. #ifdef TEXTCOLOR
  43.     uchar oc_color;        /* color of the object */
  44. #endif /* TEXTCOLOR */
  45. #define    nutrition    oc_oi    /* for foods */
  46. #define w_propellor    oc_oi    /* for weapons */
  47. #define WP_BOW        1
  48. #define WP_SLING    2
  49. #define WP_CROSSBOW    3
  50. #define    a_ac        oc_oc1    /* for armors - used in ARM_BONUS in do.c */
  51. #define    a_can        oc_oc2    /* for armors */
  52. #define bits        oc_oc1    /* for wands */
  53.                 /* wands */
  54. #define        NODIR        1
  55. #define        IMMEDIATE    2
  56. #define        RAY        4
  57.   /* Check the AD&D rules!  The FIRST is small monster damage. */
  58. #define    wsdam        oc_oc1    /* for weapons, PICK_AXE, rocks, and gems */
  59. #define    wldam        oc_oc2    /* for weapons, PICK_AXE, rocks, and gems */
  60.  
  61. #define    g_val        oc_cost    /* for gems: value on exit */
  62.  
  63. #ifdef SPELLS
  64. #define spl_lev        oc_oi    /* for books: spell level */
  65. #endif
  66. };
  67.  
  68. #if defined(MACOS) && !defined(MAKEDEFS_C)
  69. struct small_objclass{
  70.     char *oc_name;        /* actual name */
  71.     char *oc_descr;        /* description when name unknown */
  72. };
  73. extern struct small_objclass sm_obj[];
  74. extern struct objclass *objects;
  75. #else
  76. extern struct objclass NEARDATA objects[];
  77. #endif    /* MACOS && !MAKEDEFS_C */
  78.  
  79. /* definitions of all object-symbols */
  80.  
  81. #define    RANDOM_SYM    '\0'    /* used for generating random objects */
  82. #define    ILLOBJ_SYM    ']'    /* should be same as S_MIMIC_DEF      */
  83. #define    AMULET_SYM    '"'
  84. #define    FOOD_SYM    '%'
  85. #define    WEAPON_SYM    ')'
  86. #define    TOOL_SYM    '('
  87. #define    BALL_SYM    '0'
  88. #define    CHAIN_SYM    '_'
  89. #define    ROCK_SYM    '`'
  90. #define    ARMOR_SYM    '['
  91. #define    POTION_SYM    '!'
  92. #define    SCROLL_SYM    '?'
  93. #define    WAND_SYM    '/'
  94. #define    RING_SYM    '='
  95. #define    GEM_SYM        '*'
  96. #define    GOLD_SYM    '$'
  97. #define    VENOM_SYM    '.'
  98. #ifdef SPELLS
  99. #define    SPBOOK_SYM    '+'    /* actually SPELL-book */
  100. #endif
  101.  
  102. #ifdef TUTTI_FRUTTI
  103. struct fruit {
  104.     char fname[PL_FSIZ];
  105.     int fid;
  106.     struct fruit *nextf;
  107. };
  108. #define newfruit() (struct fruit *)alloc(sizeof(struct fruit))
  109. #endif
  110. #endif /* OBJCLASS_H */
  111.